package com.yyw.foodie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yyw.foodie.pojo.OrdersEntity;
import com.yyw.foodie.vo.center.order.MainOrder;
import com.yyw.foodie.vo.center.order.OrderTrend;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 订单表; Mapper 接口
 * </p>
 *
 * @author yiyw
 * @since 2021-05-22
 */
public interface OrdersMapper extends BaseMapper<OrdersEntity> {

    /**
     * 分页获取用户的订单信息
     * @param userId
     * @param orderStatus
     * @return
     */
    List<MainOrder> getOrderInfoByPage(@Param("userId") String userId, @Param("orderStatus") Integer orderStatus);

    /**
     * 分页获取订单的最新动向信息
     * @param userId  用户ID
     * @return
     */
    List<OrderTrend> getOrderTrends(@Param("userId") String userId);
}
